package com.suse.warmstill.controller;

import com.suse.warmstill.common.model.CallResult;
import com.suse.warmstill.common.model.ListPageModel;

import com.suse.warmstill.service.DOkerWxService;
import com.suse.warmstill.vo.ConditionVO;
import com.suse.warmstill.vo.DockerIndexVo;

import com.suse.warmstill.vo.DockerWxVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author 黄靖
 * @author 2022-11-04 12:03
 * description:
 **/
@RestController
@Api(tags = "wx的 医生管理")
@RequestMapping("/wx/dockers")
public class WxDockerApi {

    @Resource
    private DOkerWxService dOkerService;


    @PostMapping("/list")
    @ApiOperation("首页查询所有的首页医生")
    public CallResult<ListPageModel<DockerIndexVo>> list(@RequestBody @Validated ConditionVO conditionVO) {
        ListPageModel<DockerIndexVo> list = dOkerService.list(conditionVO);

        return CallResult.success(list);
    }

    @GetMapping("/getOne/{id}")
    @ApiOperation("查询单个的首页医生")
    public CallResult<DockerWxVo> getOne(@PathVariable("id")Integer id) {

        DockerWxVo docker = dOkerService.getOne(id);
        return CallResult.success(docker);
    }


}
